﻿<html>
<head>
	<title>Functions - Overloading with Default Values</title>
	<link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
	<div id="js-console"></div>
	<script src="scripts/js-console.js"></script>
	<script type="text/javascript">
		function contains(arr, value, start, end) {
			start = start || 0;
			end = end || arr.length;
			for (var i = start; i < end; i++) {
				if (arr[i] === value) {
					return true;
				}
			}
			return false;
		}
		var arr = [1, 2, 3, 4, 5, 6, 7, 8];
		jsConsole.writeLine(contains(arr, 3));
		jsConsole.writeLine(contains(arr, 3, 3));
		jsConsole.writeLine(contains(arr, 3, 0, 1));
	</script>
</body>
</html>
